using Gateway.IApplication.UserMessage.Input;
using Gateway.Infrastructure.AutoDI;

namespace Gateway.IApplication.UserMessage;

/// <summary>
/// user message 
/// </summary>
public interface IUserMessageApp : IDependency
{
    /// <summary>
    /// 创建user client
    /// </summary>
    /// <param name="connectionId"></param>
    /// <param name="account"></param>
    /// <returns></returns>
    Task<bool> CreateClient(string connectionId, string account);

    /// <summary>
    /// 获取connectionId
    /// </summary>
    /// <param name="account"></param>
    /// <returns></returns>
    Task<List<string>> GetConnectionIdByAccount(string account);

    /// <summary>
    /// 移除user client
    /// </summary>
    /// <param name="account"></param>
    /// <param name="connectionId"></param>
    /// <returns></returns>
    Task<bool> RemoveClient(string account, string connectionId);


    /// <summary>
    /// 创建消息
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<string> CreateMessage(CreateUserMessageInput input);


    /// <summary>
    /// 将消息状态置位已读
    /// </summary>
    /// <param name="messageId"></param>
    /// <returns></returns>
    Task<bool> Read(string messageId);


    /// <summary>
    /// 将消息状态置位已读
    /// </summary>
    /// <param name="userId"></param>
    /// <returns></returns>
    Task<bool> ReadAll(string userId);
    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    Task<bool> RemoveLongTimeNoUse();


    /// <summary>
    /// 创建用户任务
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<string> CreateTask(CreateUserTaskInput input);


    /// <summary>
    /// 设置任务结果
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task SetTaskResult(SetTaskResultInput input);
}